package com.bjesc_b2c.app.appraiset.adapter;

import android.content.Context;
import android.text.TextUtils;

import com.bjesc_b2c.app.appraiset.R;
import com.example.codeutils.utils.TimeUtils;

import java.util.List;

import app.pinggushi.bjesc.com.baserecyclerview.adapter.CommonAdapter;
import app.pinggushi.bjesc.com.baserecyclerview.adapter.base.ViewHolder;
import master_bean.ToDayBean;

/**
 * Created by Jason Chen on 2017/2/20.
 */

public class ToDayPlanAdapter extends CommonAdapter<ToDayBean> {


    public ToDayPlanAdapter(Context context, int layoutId, List<ToDayBean> datas) {
        super(context, layoutId, datas);
    }
    @Override
    protected void convertView(ViewHolder holder, ToDayBean o, int position) {

       if(!TextUtils.isEmpty(o.getDealer_address())){
           holder.setText(R.id.tv_item_dealer_address,
                   "车行地址: "+o.getDealer_address());    //车行地址
       }
//        "car_id": "90055",
//                "brand_name": "北汽新能源",
//                "series_name": "EV系列",
//                "spec_name": "2013款 电动版",
//                "track_time": "1493686159",
//                "one_status": "TRACK",
//                "dealer_address": "",
//                "dealer_name": "",
//                "car_name": "北汽新能源EV系列2013款 电动版"

        if(!TextUtils.isEmpty(o.getDealer_name())){
            holder.setText(R.id.tv_item_dealer_name,"车行名称: "+o.getDealer_name());              //车行名称
        }
        if(!TextUtils.isEmpty(o.getBrand_name())){
            holder.setText(R.id.tv_car_brand,o.getBrand_name());               //设置车品牌
        }
        if (!TextUtils.isEmpty(o.getCar_name())){
            holder.setText(R.id.tv_item_car_style,"车辆款型："+o.getCar_name());
        }
        holder.setText(R.id.tv_track_time,"录入时间: "+ TimeUtils.millis2String(o.getTrack_time()));              //车行名称

    }
}
